package model

import (
	"github.com/gogf/gf/v2/util/gmeta"
)

type RoleIdRes struct {
	Id int64 `json:"id"  dc:"角色id"    v:"required#角色id必填"`
}

type CreatedTime struct {
	CreatedAt string `json:"createdAt"  dc:"创建时间"`
}

type RoleInfo struct {
	RoleName   string  `json:"roleName"  dc:"角色名称"    v:"required#角色名称必填"`
	RoleRemark string  `json:"roleRemark"  dc:"角色备注"  v:"length:1,45#角色备注1~45字"`
	CompanyId  int64   `json:"companyId" dc:"公司Id" v:"required#公司id必填"`
	IsAdmin    int     `json:"isAdmin" dc:"-1 false 1 true 是否是超级管理员"   v:"required|in:-1,1#IsAdmin必填|IsAdmin只能按枚举值查询"`
	AuthIds    []int64 `json:"authIds"  v:"required-if:IsAll,-1#IsAdmin为-1请填写authIds"  dc:"权限列表id数组"`
}

type RoleInfoRes struct {
	*RoleInfo
	*RoleIdRes
}

type RoleDbInfoRes struct {
	gmeta.Meta `orm:"table:lot_role"`
	*RoleInfo
	*RoleIdRes
	*CreatedTime
	CompanyInfo *CompanyIdAndInfoRes `json:"companyInfo" dc:"公司信息"  orm:"with:id=company_id"`
}

type RoleListPageRes struct {
	List []*RoleDbInfoRes `json:"list"  dc:"角色列表"`
	PutPage
}

type AuthInfoList []AuthInfo

type RoleDetailsInfoRes struct {
	RoleInfo
	RoleIdRes
	AuthInfoList
}

type RoleListInfoRes struct {
	RoleInfo
	RoleIdRes
}

type RoleTerm struct {
	RoleName  string `json:"roleName"  dc:"角色名称"`
	IsAdmin   int    `json:"isAdmin" dc:"-1 false 1 true 是否是超级管理员"  v:"in:-1,1#IsAdmin只能按枚举值查询"`
	CompanyId int64  `json:"companyId" dc:"公司Id" `
	*Paging
}
